<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script src="./js/vue.js"></script>
    <div id='app'>
        <p>{{ this.firstName+" "+this.lastName}}</p><!--第一种直接用插值表达式拼接-->
        <p>{{getFullName()}}</p><!--第二种采用方法名-->
        <p>{{getFullName()}}</p>
        <p>{{getFullName()}}</p>
        <p>{{getFullName()}}</p>
        <p>{{getFullName()}}</p>

       <p>{{fullName}}</p><!--第三种通过计算属性-->
    </div>
    
    <script>
        let app =new Vue({
             el:"#app",
             data:{
                msg:'hello world',
                firstName:'Zihao',
                lastName:'Hui'
             },
             methods: {
                getFullName(){//原始方法
                    return this.firstName+" "+this.lastName
                }
             },
             computed:{//计算属性
                fullName(){
                    return this.firstName+" "+this.lastName
                }
            }
        })
    </script>
</body>
</html>